﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using GalaSoft.MvvmLight;
using MaterialDesignThemes.Wpf;
using ZFSDomain.Common.UserControls;
using ZFSDomain.Common.UserControls.Common;
using ZFSDomain.Interface.User;
using ZFSDomain.SysModule;
using ZFSDomain.ViewModel.Step;

namespace ZFSDomain.ViewDialog.Step
{
    /// <summary>
    /// 消息处理-HOST
    /// </summary>
    public class MsgHostBoxViewDlg : BaseViewDialog<MsgHostBox>, IMsgHostBoxDialog
    {
    }

    /// <summary>
    /// 消息处理-Window
    /// </summary>
    public class MsgBoxViewDlg : BaseViewDialog<MsgBox>, IMsgBoxDialog
    {

        public override void BindViewModel<TViewModel>(TViewModel viewModel)
        {
            var dialog = GetDialog();
            (dialog as Window).DataContext = viewModel;
        }

        public override Task<bool> ShowDialog(DialogOpenedEventHandler openedEventHandler, DialogClosingEventHandler closingEventHandler)
        {
            var dialog = GetDialog();
            (dialog as Window).ShowDialog();
            return Task.FromResult(((dialog as Window).DataContext as BaseDialogOperation).Result);
        }
    }
}
